package com.sjl.mapper.comm;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

/**
 * @author sjl
 * @version V1.
 * @date 2018/12/27 0027 15:36
 */
@Repository
@Mapper
public interface GenericDao {


    @UpdateProvider(type = InsertUpdateSqlProvider.class, method = "updateById")
    int updateById( Object bean, String keyName);


    @UpdateProvider(type = InsertUpdateSqlProvider.class, method = "updateNonNullById")
    int updateNonNullById(Object bean,String keyName);

    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    @InsertProvider(type = InsertUpdateSqlProvider.class, method = "insert")
    int insert(Object bean);

    @InsertProvider(type = InsertUpdateSqlProvider.class, method = "insert")
    int insertWithoutGeneratedKey(Object bean);


}
